<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="app">
        <div>app</div>
    </div>
    <button>复制节点</button>
    <script>
        document.querySelector('button').onclick = function(){
            // 参数控制是否要复制子元素
            var dom = document.querySelector('.app').cloneNode(true)
            // console.log(dom);
           document.body.appendChild(dom); 
        }
    </script>
</body>
</html>